import { storeToRefs } from 'pinia';
import { useCityList } from '/@/stores/cityList';
const storesCity = useCityList();
const { GB, US, DE } = storeToRefs(storesCity);

export default function () {
	// 站点
	const SITE_GB = 1; // 英国
	const SITE_US = 2; // 美国
	const SITE_DE = 0; // 德国
	// 根据站点标识来返回对应的站点
	const getSiteByPlatform = (params) => {
		let text = '';
		switch (params) {
			case SITE_GB:
				text = '英国';
				break;
			case SITE_US:
				text = '美国';
				break;
			case SITE_DE:
				text = '德国';
				break;
			default:
				text = '';
				break;
		}
		return text;
	};
	// 根据国家英文简称返回对应的国家名称
	const getSiteByCountryAbbreviation = (params) => {
		let text = '';
		switch (params) {
			case GB:
				text = '英国';
				break;
			case US:
				text = '美国';
				break;
			case DE:
				text = '德国';
				break;
			default:
				text = '';
				break;
		}
		return text;
	};

	return {
		SITE_GB,
		SITE_US,
		SITE_DE,
		getSiteByPlatform,
		getSiteByCountryAbbreviation,
	};
}
